﻿@model DotNetMVC.OA.Model.ActionInfo

@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>Edit</title>
    <script src="~/Scripts/jquery.min.js"></script>
    <script type="text/javascript">
        //提交表单
        function submitForm() {
            $.ajax({
                type: 'post',
                url: '/ActionInfo/Edit/',
                data: $("form").serialize(),
                success: function (data) {
                    if (data == "ok") {
                        //调用父窗口方法
                        window.parent.window.afterEditSuccess();
                    } else {
                        //错误信息
                        window.parent.window.afterEditError(data);
                    }
                }
            });
        }
    </script>
</head>
<body>
    @using (Html.BeginForm())
    {
        @Html.AntiForgeryToken()
        
        <div class="form-horizontal">
            @Html.ValidationSummary(true, "", new { @class = "text-danger" })
            @****************** 隐藏字段 ******************@
            @Html.HiddenFor(model => model.ID)
            @Html.HiddenFor(model => model.DelFlag)
            @****************** 隐藏字段赋值 ******************@
            @Html.HiddenFor(model => model.ModfiedOn, new { @Value = @DateTime.Now })
            @Html.HiddenFor(model => model.SubTime)
    
      

    
            <div class="form-group">
                @Html.LabelFor(model => model.ActionName,"权限名", htmlAttributes: new { @class = "control-label col-md-2" })
                <div class="col-md-10">
                    @Html.EditorFor(model => model.ActionName, new { htmlAttributes = new { @class = "form-control" } })
                    @Html.ValidationMessageFor(model => model.ActionName, "", new { @class = "text-danger" })
                </div>
            </div>
    
            <div class="form-group">
                @Html.LabelFor(model => model.Url,"URL", htmlAttributes: new { @class = "control-label col-md-2" })
                <div class="col-md-10">
                    @Html.EditorFor(model => model.Url, new { htmlAttributes = new { @class = "form-control" } })
                    @Html.ValidationMessageFor(model => model.Url, "", new { @class = "text-danger" })
                </div>
            </div>
    
            <div class="form-group">
                @Html.LabelFor(model => model.HttpMethod,"Http方式", htmlAttributes: new { @class = "control-label col-md-2" })
                <div class="col-md-10">
                    @Html.EditorFor(model => model.HttpMethod, new { htmlAttributes = new { @class = "form-control" } })
                    @Html.ValidationMessageFor(model => model.HttpMethod, "", new { @class = "text-danger" })
                </div>
            </div>
    
            <div class="form-group">
                @Html.LabelFor(model => model.IsMenu,"是否是菜单", htmlAttributes: new { @class = "control-label col-md-2" })
                <div class="col-md-10">
                    <div class="checkbox">
                        @Html.EditorFor(model => model.IsMenu)
                        @Html.ValidationMessageFor(model => model.IsMenu, "", new { @class = "text-danger" })
                    </div>
                </div>
            </div>
    
            <div class="form-group">
                @Html.LabelFor(model => model.MenuIcon,"菜单图标", htmlAttributes: new { @class = "control-label col-md-2" })
                <div class="col-md-10">
                    @Html.EditorFor(model => model.MenuIcon, new { htmlAttributes = new { @class = "form-control" } })
                    @Html.ValidationMessageFor(model => model.MenuIcon, "", new { @class = "text-danger" })
                </div>
            </div>
    
            <div class="form-group">
                @Html.LabelFor(model => model.Sort,"排序", htmlAttributes: new { @class = "control-label col-md-2" })
                <div class="col-md-10">
                    @Html.EditorFor(model => model.Sort, new { htmlAttributes = new { @class = "form-control" } })
                    @Html.ValidationMessageFor(model => model.Sort, "", new { @class = "text-danger" })
                </div>
            </div>
    
            <div class="form-group">
                @Html.LabelFor(model => model.Remark, "备注", htmlAttributes: new { @class = "control-label col-md-2" })
                <div class="col-md-10">
                    @Html.EditorFor(model => model.Remark, new { htmlAttributes = new { @class = "form-control" } })
                    @Html.ValidationMessageFor(model => model.Remark, "", new { @class = "text-danger" })
                </div>
            </div>
        </div>
    }
</body>
</html>
